<div class="modal top"  style="width: 520px; min-height: 200px; top: 35px; right: 190px;"> 
	<div class="modal-body">
		<div id="login-items" class="login-items">
			<div class="item">  
				<input type="text" name="email" placeholder="邮箱"> 
				<span class="tip">输入Email地址</span>
			</div> 
			<div class="item">  
				<input type="password" name="password" placeholder="密码"> 
				<span>忘记密码？ <a href="#">找回密码</a></span>
			</div>
			<label>
	             <input type="checkbox" name="remember" checked="checked">
	             <span>下次自动登录</span> 
        	</label>
 		</div> 
	</div> 
	<div class="modal-footer">
		<a href="#" class="btn primary" onclick="login()">登录</a>
		<a href="#" class="btn" onclick="toggleLogin()">取 消</a>
	</div> 
</div>
<script type="text/javascript">
$(function(){
	$("#login-items input[name='email']").focus();
	
	$(".item input[name=email]").autocomplete({
		source: emailHelper,
		delay: 0,
		autoFocus: true
	}); 

	$("#login-items input[name=email]").keypress(function(e){
		if(e.which == 13){
			$("#login-items input[name=password]").focus();
	    }
	});  
	$("#login-items input[name=password]").keypress(function(e){
		if(e.which == 13){
			login();
	    }
	});
	
	$("#login-items input[name=email]").focusout(function(){
		if(!checkEmail($(this))){  
			$(this).parent().children("span").html("非法邮箱地址").css("color","red"); 
		}else{
			$(this).parent().children("span").html("OK").css("color","green");
		}
	});
});
</script>